package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.time.LocalDate;
import java.util.List;

@TableName("t_order")
public class OrderBean {
    /**订单编号*/
    @TableId(value = "pk_orderId",type = IdType.AUTO)
    private Integer id;
    /**收货人*/
    @TableField("o_accept")
    private String  accept;
    /**收货地址*/
    @TableField("o_address")
    private String  address;
    /**收货人电话*/
    @TableField("o_phone")
    private String phone;
    /**下单时间*/
    @TableField("o_date")
    private LocalDate orderDate = LocalDate.now();
    /**订单总价*/
    @TableField("o_money")
    private Integer money;
    /**订单状态*/
    @TableField("o_status")
    private String status = "未发货";
    /**用户编号*/
    @TableField("fk_userId")
    private Integer userId;
    /**订单详情集合*/
    @TableField(exist = false)
    private List<OrderInfoBean> orderInfoList;

    public OrderBean(String accept, String address, String phone, Integer userId) {
        this.accept = accept;
        this.address = address;
        this.phone = phone;
        this.userId = userId;
    }

    public OrderBean() {
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getAccept() {
        return accept;
    }

    public void setAccept(String accept) {
        this.accept = accept;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public LocalDate getOrderDate() {
        return orderDate;
    }

    public void setOrderDate(LocalDate orderDate) {
        this.orderDate = orderDate;
    }

    public Integer getMoney() {
        return money;
    }

    public void setMoney(Integer money) {
        this.money = money;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public List<OrderInfoBean> getOrderInfoList() {
        return orderInfoList;
    }

    public void setOrderInfoList(List<OrderInfoBean> orderInfoList) {
        this.orderInfoList = orderInfoList;
    }

    @Override
    public String toString() {
        return "OrderBean{" +
                "id=" + id +
                ", accept='" + accept + '\'' +
                ", address='" + address + '\'' +
                ", phone='" + phone + '\'' +
                ", orderDate=" + orderDate +
                ", money=" + money +
                ", status='" + status + '\'' +
                ", userId=" + userId +
                ", orderInfoList=" + orderInfoList +
                '}';
    }
}
